package com.lanchetech.dao;

import com.lanchetech.entity.MerchantPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MerchantPermissionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MerchantPermission record);

    int insertSelective(MerchantPermission record);

    MerchantPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MerchantPermission record);

    int updateByPrimaryKey(MerchantPermission record);

    @Select("select p.id, p.catalog, p.name, p.permission from merchant_role_permission a left join merchant_permission p on p.id = a.permission_id where role_id = #{roleId}")
    List<MerchantPermission> getMerchantPermissionList(Long roleId);

    List<MerchantPermission> findAll();


}